package it.koutifaris.travianmap.tile.tilemap;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import it.koutifaris.travianmap.model.Alliance;
import it.koutifaris.travianmap.model.Player;
import it.koutifaris.travianmap.model.Tribe;
import it.koutifaris.travianmap.model.Village;

public class DomainMocukpFactory {

	public Alliance allianceMockup() {
		Alliance ally = mock(Alliance.class);

		when(ally.getElementId()).thenReturn(1);
		when(ally.getName()).thenReturn("Test Alliance");

		return ally;
	}

	public Player playerMockup() {
		Player player = mock(Player.class);

		when(player.getElementId()).thenReturn(1);
		when(player.getName()).thenReturn("Test Player");
		Alliance allianceMockup = allianceMockup();
		when(player.getAlliance()).thenReturn(allianceMockup);
		when(player.getTribe()).thenReturn(Tribe.ROMAN);

		return player;
	}

	public Village villageMockup(int x, int y) {
		Village village = mock(Village.class);

		when(village.getElementId()).thenReturn(1);
		when(village.getName()).thenReturn("Test Village");
		when(village.getPopulation()).thenReturn(100);
		Player playerMockup = playerMockup();
		when(village.getOwner()).thenReturn(playerMockup);

		when(village.getX()).thenReturn(x);
		when(village.getY()).thenReturn(y);

		return village;
	}

}
